package com.huangmb.androidlib.utils;

import android.content.Context;
import android.widget.Toast;

/**
 * 备注:
 *
 * @author hmb
 * @version 1.0
 * @since 2016/4/4 13:37
 */
public class ToastUtils {
    private ToastUtils(){

    }
    private final static boolean isShow = true;
    public static void showShort(Context context, String msg){
        if(isShow){
            Toast.makeText(context,msg, Toast.LENGTH_SHORT).show();
        }
    }
    public static void showLong(Context context, String msg){
        if(isShow){
            Toast.makeText(context,msg, Toast.LENGTH_LONG).show();
        }
    }

    /**
     *
     * @param context
     * @param id 字符串资源id
     */
    public static void showShort(Context context, int id){
        showShort(context,context.getString(id));

    }

    /**
     *
     * @param context
     * @param id 字符串资源id
     */
    public static void showLong(Context context, int id){
        showLong(context,context.getString(id));
    }
}
